// 日付変換
function dateToString(date) {
	return date.getFullYear() + '/'
		+ ('00' + (date.getMonth()+1)).slice(-2) + '/'
		+ ('00' +  date.getDate()    ).slice(-2) + ' '
		+ ('00' +  date.getHours()   ).slice(-2) + ':'
		+ ('00' +  date.getMinutes() ).slice(-2);
}

function dateToShortStr(date) {
	return ('00' + (date.getMonth()+1)).slice(-2) + '/'
		+ ('00' +  date.getDate()    ).slice(-2) + ' '
		+ ('00' +  date.getHours()   ).slice(-2) + ':'
		+ ('00' +  date.getMinutes() ).slice(-2);
}

// HTMLアンエスケープ処理
function unescapeHTML(val) {
	return $('<div>').html(val).text();
}
// XMLのパース
function parseXML(src) {
	var ret = {};
	var parser = new DOMParser();
	var dom = parser.parseFromString("<par>" + src + "</par>", "text/xml");
	ret.lat = dom.getElementsByTagName("lat")[0].textContent;
	ret.lon = dom.getElementsByTagName("lon")[0].textContent;
	ret.count = dom.getElementsByTagName("count")[0].textContent;
	return ret;
}

